package com.atguigu.util;

import java.util.UUID;

/**
 * @author gan
 * @create 2021-07-02 9:58
 */
public class UuidWorkerInit {
    public UuidWorkerInit() {
    }

    public static String[] getUUID(int number) {
        if (number < 1) {
            return null;
        } else {
            String[] retArray = new String[number];

            for(int i = 0; i < number; ++i) {
                retArray[i] = getUUID();
            }

            return retArray;
        }
    }

    public static String getUUID() {
        String uuid = UUID.randomUUID().toString();
        return uuid.replaceAll("-", "");
    }

    public static void main(String[] args) {
        System.out.println( getUUID());
    }
}